package nccloud.web.obm.pubinfo.currentaccount.action;

import java.util.ArrayList;
import java.util.Map;

import nc.impl.pubapp.pattern.database.IDQueryBuilder;
import nccloud.itf.bd.currentaccount.ICurrentaccountQryService;
import nc.vo.obm.currentaccountbalance.CurrentAccountVO;
import nccloud.framework.service.ServiceLocator;
import nccloud.framework.web.container.IRequest;
import nccloud.framework.web.ui.pattern.grid.Grid;
import nccloud.framework.web.ui.pattern.grid.GridOperator;
import nccloud.web.action.NCCAction;

/***************************************************************
* @author tangcht
* @version nccloud1.0
* @since 2018-9-30
* @see
***************************************************************/
public class CurrentaccountQueryPageGridByPksAction extends NCCAction {

@Override
public <T> Object execute(IRequest request, T para) throws Exception {
    Grid grid = null;
    Map<String, Object> paras = (Map<String, Object>) para;
    String[] pks = (String[]) ((ArrayList) paras.get("pks")).toArray(new String[0]);
    IDQueryBuilder sqlbuilder = new IDQueryBuilder();
    String wherePart = sqlbuilder.buildSQL("pk_currentaccount", pks);
    ICurrentaccountQryService qryService = ServiceLocator.find(ICurrentaccountQryService.class);
    CurrentAccountVO[] vos = qryService.query(wherePart);
    GridOperator opr = new GridOperator(CurrentaccountConsts.pagecode);
    grid = opr.toGrid(vos);
    return grid;
    }

    }
